package com.shujia.profile.info.social

import com.shujia.profile.UserProfile
import com.shujia.util.SparkUtil
import org.apache.spark.sql.{DataFrame, SparkSession}

class UserProfilePhone extends UserProfile {

  flagName = "phone"

  override def extractProfile(spark: SparkSession): DataFrame = {
    import spark.implicits._

    val member: DataFrame = spark.table("dim.dim_pub_t_member")

    //提取手机号标签
    val profilePhone: DataFrame = member.select($"id", $"phone")

    //返回提取的用户画像
    profilePhone
  }
}
object UserProfilePhone {
  def main(args: Array[String]): Unit = {
    //获取参数,在提交任务时，在包名后面增加的参数
    val ds: String = args.head
    //spark环境
    val spark: SparkSession = SparkUtil.getSession()

    new UserProfilePhone().run(spark, ds)
  }
}
